#ifndef __PLATFORM_H__
#define __PLATFORM_H__

#include ISA_H 

#define nemu_trap(code) asm volatile("mv a0, %0; .word 0x0000006b" : :"r"(code))

// #define SERIAL_PORT  0xa10003f8
// #define KBD_ADDR     0xa1000060
// #define RTC_ADDR     0xa1000048
// #define SCREEN_ADDR  0xa1000100
// #define SYNC_ADDR    0xa1000104
// #define FB_ADDR      0xa0000000

#define PMEM_SIZE (128 * 1024 * 1024)
#define PGSIZE    4096

#define MMIO_BASE 0xa0000000
#define MMIO_SIZE 0x10000000


#define SERIAL_STATE 0x00100008
#define SERIAL_DATA  0x00100004

#define AXI_TEST_REG1 0x00000000
#define AXI_TEST_REG2 0x00000004
#define AXI_TEST_REG3 0x00000008
#define AXI_TEST_REG4 0x0000000c

#endif
